-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for DMG and Downloads folder detection in macOS Sierra #60
base: master
Are you sure you want to change the base?
Fix for DMG and Downloads folder detection in macOS Sierra #60
Conversation
…and uses the original application path instead of the path the app is running from. This fixes DMG and Download folder detection, which is broken when running from a Translocated path.
Hi Jeremy, I'm a bit hesitant to merge this because it's using undocumented API. LetsMove works fine even under translocation right now because translocated app is the same as the "real" app. Can you tell me why you think this is necessary? |
When Sierra was released, my team noticed that the detection of the app being in the downloads folder or a mounted disk image was not functional anymore. This appeared to be because those detection methods relied on looking at the original application launch path, which is obscured for translocated apps. The Security framework in the macOS Sierra beta SDK had documented functions for determining if an app was running translocated and finding the original launch path if so. They were removed in the release SDK (I haven’t checked if they reappeared, but I’m guessing no) but the symbols are still present and the lookup is safe. |
Note that since macOS 14 Mojave, it is not possible to send Apple events to Finder without user confirmation, so the AppleScript trick doesn't work anymore for translocated apps. Perhaps using hidden Security functions is the only solution. |
What is the “AppleScript trick” used for? I don’t recall seeing that routine. |
@JeremyAgost I was referring to this line: https://github.com/potionfactory/LetsMove/blob/master/PFMoveApplication.m#L408 It seems that all other attempts at removing a translocated app fails, and this last resort was blocked in macOS 14. |
Any update on this? |
Fix Downloads folder detection on macOS > Sierra See potionfactory#60 Relevant: * https://opensource.apple.com/source/Security/Security-57740.51.3/OSX/libsecurity_translocate/lib/SecTranslocate.h.auto.html * https://lapcatsoftware.com/articles/detect-app-translocation.html
Check whether the app is running under Translocation on macOS Sierra and uses the original application path instead of the path the app is running from. This fixes DMG and Downloads folder detection, which is broken when running from a Translocated path.
I applied a similar fix to the fork we use in our app, but it was ObjC++ so I had to tweak it for you guys.